package com.qf.j2112.service.impl;

import com.qf.j2112.po.SysOrderitem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qf.j2112.mapper.SysOrderitemMapper;
import com.qf.j2112.service.SysOrderitemService;

import java.util.List;

/**
 * 订单详情Service业务层处理
 * 
 * @author j2112
 * @date 2022-04-12
 */
@Service
public class SysOrderitemServiceImpl implements SysOrderitemService {
    @Autowired
    private SysOrderitemMapper sysOrderitemMapper;

    /**
     * 查询订单详情
     * 
     * @param orderitemId 订单详情主键
     * @return 订单详情
     */
    @Override
    public SysOrderitem selectSysOrderitemByOrderitemId(Integer orderitemId) {
        return sysOrderitemMapper.selectSysOrderitemByOrderitemId(orderitemId);
    }

    /**
     * 查询订单详情列表
     * @param sysOrderitem 订单详情
     * @return 订单详情
     */
    @Override
    public List<SysOrderitem> selectSysOrderitemList(SysOrderitem sysOrderitem) {
        return sysOrderitemMapper.selectSysOrderitemList(sysOrderitem);
    }

    /**
     * 新增订单详情
     * @param sysOrderitem 订单详情
     * @return 结果
     */
    @Override
    public int insertSysOrderitem(SysOrderitem sysOrderitem) {
        return sysOrderitemMapper.insertSysOrderitem(sysOrderitem);
    }

    /**
     * 修改订单详情
     * @param sysOrderitem 订单详情
     * @return 结果
     */
    @Override
    public int updateSysOrderitem(SysOrderitem sysOrderitem) {
        return sysOrderitemMapper.updateSysOrderitem(sysOrderitem);
    }


    /**
     * 删除订单详情信息
     * @param orderitemId 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderitemByOrderitemId(Integer orderitemId) {
        return sysOrderitemMapper.deleteSysOrderitemByOrderitemId(orderitemId);
    }

    /**
     * 根据订单号批量删除订单详情信息
     * @param orderId 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderitemByOrderId(Integer orderId) {
        return sysOrderitemMapper.deleteSysOrderitemByOrderId(orderId);
    }
}
